//
//  SetupViewController.m
//  51易借
//
//  Created by 张睿 on 2017/8/17.
//  Copyright © 2017年 张睿. All rights reserved.
//

#import "SetupViewController.h"
#import "LoginViewController.h"
#import "VertifyViewController.h"
#import "UIWebViewController.h"

@interface SetupViewController ()<UITextFieldDelegate>

@property (nonatomic, weak)UIImageView * topView;
@property (nonatomic, weak)UIView * inputView;
@property (nonatomic, weak)UILabel * accountLabel;
@property (nonatomic, weak)UITextField * telTextField;
@property (nonatomic, weak)UIView * lineOneView;
@property (nonatomic, weak)UILabel * veriftyLabel;
@property (nonatomic, weak)UITextField * veriftyTextField;
@property (nonatomic, weak)UIView * lineTwoView;
@property (nonatomic, weak)UILabel * passwordLabel;
@property (nonatomic, weak)UITextField * passwordTextField;
@property (nonatomic, weak)UIButton * imageButton;
@property (nonatomic, weak)UIButton * checkButton;
@property (nonatomic, weak)UILabel * rulesLabel;
@property (nonatomic, weak)UIButton * nextButton;
@property (nonatomic, weak)UIButton * loginButton;

@end

@implementation SetupViewController


- (void)viewWillAppear:(BOOL)animated{
    
    [self getVeriftyImage];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFieldEditChanged:)
                                                name:@"UITextFieldTextDidChangeNotification" object:self.telTextField];
    
    [self setupNavBar];
    [self setupUI];
}


- (void)setupNavBar{
    
    self.title = @"注册";
    
    UIButton * backButton = [[UIButton alloc] init];
    
    backButton.frame = CGRectMake(15 * SCREENH6, 5 * SCREENH6, 12 * SCREENH6, 20 * SCREENH6);
    [backButton setImage:[UIImage imageNamed:@"箭头"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backToLastView) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem * leftButton = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    
    self.navigationItem.leftBarButtonItem = leftButton;
}


- (void)setupUI{
    
    UIImageView * topView = [UIImageView new];
    
    topView.image = [UIImage imageNamed:@"图片"];
    
    self.topView = topView;
    
    [self.view addSubview:self.topView];
    
    
    UIView * inputView = [UIView new];
    
    inputView.backgroundColor = [UIColor whiteColor];
    inputView.layer.borderColor = [ColorWithRGB(0xe6e6e6) CGColor];
    inputView.layer.borderWidth = 0.5 * SCREENH6;
    
    self.inputView = inputView;
    
    [self.view addSubview:self.inputView];
    
    
    UILabel * accountLabel = [UILabel new];
    
    accountLabel.text = @"账号";
    accountLabel.textColor = ColorWithRGB(0x303c41);
    accountLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.accountLabel = accountLabel;
    
    [self.view addSubview:self.accountLabel];
    
    
    UITextField * accountText = [[UITextField alloc] init];
    
    accountText.borderStyle = UITextBorderStyleNone;
    accountText.backgroundColor = [UIColor clearColor];
    accountText.layer.borderColor = [[UIColor clearColor] CGColor];
    //设置光标颜色
    accountText.tintColor = ColorWithRGB(0xa5a5a5);
    //修改占位符文字颜色
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSForegroundColorAttributeName] = ColorWithRGB(0xa5a5a5);
    attrs[NSFontAttributeName] = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    accountText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入手机号码" attributes:attrs];
    accountText.textColor = ColorWithRGB(0x303c41);
    accountText.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 22 * SCREENH6, 0)];
    //设置显示模式为永远显示(默认不显示)
    accountText.leftViewMode = UITextFieldViewModeAlways;
    accountText.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    accountText.keyboardType = UIKeyboardTypeNumberPad;
    accountText.delegate = self;
    
    self.telTextField = accountText;
    
    [self.view addSubview:self.telTextField];
    
    
    UIView * lineOneView = [UIView new];
    
    lineOneView.backgroundColor = ColorWithRGB(0xe6e6e6);
    
    self.lineOneView = lineOneView;
    
    [self.view addSubview:self.lineOneView];
    
    
    UILabel * veriftyLabel = [UILabel new];
    
    veriftyLabel.text = @"密码";
    veriftyLabel.textColor = ColorWithRGB(0x303c41);
    veriftyLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.veriftyLabel = veriftyLabel;
    
    [self.view addSubview:self.veriftyLabel];
    
    
    UITextField * veriftyTextField = [[UITextField alloc] init];
    
    veriftyTextField.borderStyle = UITextBorderStyleNone;
    veriftyTextField.backgroundColor = [UIColor clearColor];
    veriftyTextField.layer.borderColor = [[UIColor clearColor] CGColor];
    //设置光标颜色
    veriftyTextField.tintColor = ColorWithRGB(0xa5a5a5);
    //修改占位符文字颜色
    veriftyTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入6~18位数字和字母组合" attributes:attrs];
    veriftyTextField.textColor = ColorWithRGB(0x303c41);
    veriftyTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 22 * SCREENH6, 0)];
    //设置显示模式为永远显示(默认不显示)
    veriftyTextField.leftViewMode = UITextFieldViewModeAlways;
    veriftyTextField.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    veriftyTextField.secureTextEntry = YES;
    veriftyTextField.delegate = self;
    
    self.veriftyTextField = veriftyTextField;
    
    [self.view addSubview:self.veriftyTextField];
    
    
    UIView * lineTwoView = [UIView new];
    
    lineTwoView.backgroundColor = ColorWithRGB(0xe6e6e6);
    
    self.lineTwoView = lineTwoView;
    
    [self.view addSubview:self.lineTwoView];
    
    
    UILabel * passwordLabel = [UILabel new];
    
    passwordLabel.text = @"图形验证";
    passwordLabel.textColor = ColorWithRGB(0x303c41);
    passwordLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.passwordLabel = passwordLabel;
    
    [self.view addSubview:self.passwordLabel];
    
    
    UITextField * passwordTextField = [[UITextField alloc] init];
    
    passwordTextField.borderStyle = UITextBorderStyleNone;
    passwordTextField.backgroundColor = [UIColor clearColor];
    passwordTextField.layer.borderColor = [[UIColor clearColor] CGColor];
    //设置光标颜色
    passwordTextField.tintColor = ColorWithRGB(0xa5a5a5);
    //修改占位符文字颜色
    passwordTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入图形验证码" attributes:attrs];
    passwordTextField.textColor = ColorWithRGB(0x303c41);
    passwordTextField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 22 * SCREENH6, 0)];
    //设置显示模式为永远显示(默认不显示)
    passwordTextField.leftViewMode = UITextFieldViewModeAlways;
    passwordTextField.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    passwordTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    
    self.passwordTextField = passwordTextField;
    
    [self.view addSubview:self.passwordTextField];
    
    
    UIButton * imageButton = [UIButton new];
    
//    imageButton.backgroundColor = [UIColor redColor];
    [imageButton addTarget:self action:@selector(getVeriftyImage) forControlEvents:UIControlEventTouchUpInside];
    [imageButton setAdjustsImageWhenHighlighted:NO];
    
    self.imageButton = imageButton;
    
    [self.view addSubview:self.imageButton];
    
    
    UIButton * checkButton = [UIButton new];
    
    checkButton.selected = YES;
    [checkButton setImage:[UIImage imageNamed:@"协议"] forState:UIControlStateNormal];
    [checkButton addTarget:self action:@selector(didCheckButton) forControlEvents:UIControlEventTouchUpInside];
    
    self.checkButton = checkButton;
    
    [self.view addSubview:self.checkButton];
    
    
    UILabel * rulesLabel = [UILabel new];
    
    rulesLabel.text = @"点击“下一步” 默认同意《51易借注册协议》。";
    rulesLabel.textColor = ColorWithRGB(0xff7907);
//    rulesLabel.font = [UIFont fontWithName:@"MicrosoftYaHei" size:10 * SCREENH6];
    rulesLabel.font = [UIFont systemFontOfSize:12 * SCREENH6];
    rulesLabel.userInteractionEnabled = YES;
     UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
    [rulesLabel addGestureRecognizer:tapGR];
    
    self.rulesLabel = rulesLabel;
    
    [self.view addSubview:self.rulesLabel];
    
    
    UIButton * nextButton = [UIButton new];
    //300 * 42
    [nextButton setTitle:@"下一步" forState:UIControlStateNormal];
    [nextButton setBackgroundImage:[UIImage imageNamed:@"登录"] forState:UIControlStateNormal];
    [nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [nextButton addTarget:self action:@selector(didNextButton) forControlEvents:UIControlEventTouchUpInside];
    nextButton.titleLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    
    self.nextButton = nextButton;
    
    [self.view addSubview:self.nextButton];
    
    
    UIButton * loginButton = [UIButton new];
    //300 * 42
    [loginButton setTitle:@"已有账户，立即登入" forState:UIControlStateNormal];
    [loginButton setBackgroundImage:[UIImage imageNamed:@"立即注册"] forState:UIControlStateNormal];
    [loginButton setBackgroundColor:[UIColor whiteColor]];
    [loginButton setTitleColor:ColorWithRGB(0xff7907) forState:UIControlStateNormal];
    [loginButton addTarget:self action:@selector(didLoginButton) forControlEvents:UIControlEventTouchUpInside];
    loginButton.titleLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    
    self.loginButton = loginButton;
    
    [self.view addSubview:self.loginButton];
    
}


- (void)viewDidLayoutSubviews{
    
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.leading.trailing.mas_equalTo(self.view);
        make.height.mas_equalTo(200 * SCREENH6);
    }];
    
    
    [self.inputView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.topView.mas_bottom).offset(10 * SCREENH6);
        make.leading.mas_equalTo(self.view).offset(5 * SCREENH6);
        make.trailing.mas_equalTo(self.view).offset(-5 * SCREENH6);
        make.height.mas_equalTo(145 * SCREENH6);
    }];
    
    [self.accountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.inputView).offset(15 * SCREENH6);
        make.leading.mas_equalTo(self.inputView).offset(15 * SCREENH6);
    }];
    
    [self.telTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(270 * SCREENH6);
        make.centerY.mas_equalTo(self.accountLabel);
        make.trailing.mas_equalTo(self.inputView);
        make.height.mas_equalTo(40 * SCREENH6);
    }];
    
    [self.lineOneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self.inputView);
        make.height.mas_equalTo(0.5 * SCREENH6);
        make.top.mas_equalTo(self.telTextField.mas_bottom).offset(5 * SCREENH6);
    }];
    
    [self.veriftyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.accountLabel);
        make.top.mas_equalTo(self.lineOneView.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.veriftyTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.height.width.mas_equalTo(self.telTextField);
        make.centerY.mas_equalTo(self.veriftyLabel);
    }];
    
    [self.lineTwoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.height.mas_equalTo(self.lineOneView);
        make.top.mas_equalTo(self.veriftyTextField.mas_bottom).offset(5 * SCREENH6);
    }];
    
    [self.passwordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.veriftyLabel);
        make.top.mas_equalTo(self.lineTwoView.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.passwordTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.height.mas_equalTo(self.veriftyTextField);
        make.centerY.mas_equalTo(self.passwordLabel);
        make.width.mas_equalTo(170 * SCREENH6);
    }];
    
    
    [self.imageButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.passwordTextField);
        make.height.mas_equalTo(25 * SCREENH6);
        make.trailing.mas_equalTo(self.inputView).offset(-5 * SCREENH6);
        make.leading.mas_equalTo(self.passwordTextField.mas_trailing).offset(5 * SCREENH6);
    }];
    
    [self.checkButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.inputView.mas_bottom).offset(18 * SCREENH6);
        make.leading.mas_equalTo(self.inputView).offset(17 * SCREENH6);
        make.height.width.mas_equalTo(17 * SCREENH6);
    }];
    
    [self.rulesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.checkButton);
        make.leading.mas_equalTo(self.checkButton.mas_trailing).offset(5 * SCREENH6);
    }];
    
    [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.height.mas_equalTo(42 * SCREENH6);
        make.width.mas_equalTo(300 * SCREENH6);
        make.top.mas_equalTo(self.rulesLabel.mas_bottom).offset(40 * SCREENH6);
    }];
    
    [self.loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.leading.trailing.mas_equalTo(self.nextButton);
        make.top.mas_equalTo(self.nextButton.mas_bottom).offset(10 * SCREENH6);
    }];
}



//点击协议框
- (void)didCheckButton{
    
    if (self.checkButton.selected) {
        
        self.checkButton.selected = NO;
        
        [self.checkButton setImage:[UIImage imageNamed:@"框9"] forState:UIControlStateNormal];
        
    }else{
        
        self.checkButton.selected = YES;
        
        [self.checkButton setImage:[UIImage imageNamed:@"协议"] forState:UIControlStateNormal];
    }
    
}


//切换图形验证码图片
- (void)getVeriftyImage{
    
    NSURL *url = [NSURL URLWithString:@"http://api.xianjinedai.com/common/imageVerifyCode.json"];
    
    // 创建Request请求
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    // 配置Request请求
    // 设置请求方法
    [request setHTTPMethod:@"GET"];
    // 设置请求超时 默认超时时间60s
    [request setTimeoutInterval:10.0];
    //3.获得会话对象
    NSURLSession *session = [NSURLSession sharedSession];
    
    NSURLSessionDataTask * dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
        
        //获取cookie
        NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage]cookiesForURL:[NSURL URLWithString:@"http://api.xianjinedai.com/common/imageVerifyCode.json"]];
        
//        for (NSHTTPCookie *tempCookie in cookies)
//        {
//            //打印cookies
//            NSLog(@"getCookie:%@",tempCookie);
//        }
        NSDictionary *Request = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies];
        
        NSUserDefaults *userCookies = [NSUserDefaults standardUserDefaults];
        [userCookies setObject:[Request objectForKey:@"Cookie"] forKey:@"mUserDefaultsCookie"];
        [userCookies synchronize];
        
        if (error == nil) {
            //6.解析服务器返回的数据
            //说明：（此处返回的数据是JSON格式的，因此使用NSJSONSerialization进行反序列化处理）
            NSData * data1 = (NSData *)data;
            
            UIImage *image=[[UIImage alloc] initWithData:data1];
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [self.imageButton setImage:image forState:UIControlStateNormal];
            });
            
        }
    }];
    
    //5.执行任务
    [dataTask resume];
}

//点击下一步按钮
- (void)didNextButton{
    
    
    
    ParaModel*para = [ParaModel new];
    para.imageCode = self.passwordTextField.text;
    
    [[NetworkTool shareManager] POST:[Interfacefile verifyImageCode] Param:[para toDictionary] andWaitStr:@"" waitView:self.view success:^(id  _Nullable responseObject) {
        if([[responseObject objectForKey:@"code"]intValue]==0)
        {
            VertifyViewController * vertifyVC = [VertifyViewController new];
            
            vertifyVC.telString = self.telTextField.text;
            
            NSString * password = [self md5:self.veriftyTextField.text];
            
            vertifyVC.password = password;
            
            [self.navigationController pushViewController:vertifyVC animated:YES];

        }else{
            
            [self showHint:[responseObject objectForKey:@"message"]];
            
            
        }
    } andFailure:^(NSError * _Nonnull error) {
        [self showHint:@"网络错误"];
    }];
    
    
    
//    NSDictionary * parameters = @{@"imageCode":self.passwordTextField.text};
//    NetworkTool*manager= [NetworkTool manager];
//    [manager.requestSerializer setValue: [[NSUserDefaults standardUserDefaults] objectForKey:@"mUserDefaultsCookie"] forHTTPHeaderField:@"Cookie"];
// 
//    [[NetworkTool shareManager] POST:@"common/verifyImageCode.json" parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary *  _Nullable responseObject) {
//        
//        NSLog(@"==%@",responseObject);
//        if([[responseObject objectForKey:@"code"]intValue]==0)
//        {
//                  }else
//        {
//            [self showHint:[responseObject objectForKey:@"message"]];
//
//        }
//        
//
////        NSData * data = (NSData *)responseObject;
////        
////        NSString *result  =[[ NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//
//        
//        NSString * msg = responseObject[@"message"];
//        
//        NSLog(@"msg==%@",msg);
//        
//    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//        
//        NSLog(@"==%@",error);
//        
//    }];
}



//点击登录按钮
- (void)didLoginButton{
    
//    LoginViewController * loginVC = [LoginViewController new];
//    
//    [self.navigationController pushViewController:loginVC animated:YES];
    [self.navigationController popViewControllerAnimated:YES];
}



- (void)textFieldDidEndEditing:(UITextField *)textField{
    
    if (textField == self.telTextField) {
        
        if (textField.text.length > 0) {
            
            NSDictionary * parameters = @{@"userPhone":textField.text};
            
            [[NetworkTool shareManager] POST:@"user/checkAccountRegister.json" parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary *  _Nullable responseObject) {
                
                NSString * code = [NSString stringWithFormat:@"%@",responseObject[@"code"]];
                
                if ([code isEqualToString:@"1002"]) {
                    
                }else{
                    
                    UIAlertController* alert = [UIAlertController alertControllerWithTitle:@""
                                                                                   message:responseObject[@"message"]
                                                                            preferredStyle:UIAlertControllerStyleAlert];
                    
                    UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel
                                                                          handler:^(UIAlertAction * action) {
                                                                              //响应事件
                                                                              
                                                                          }];
                    
                    [alert addAction:defaultAction];
                    [self presentViewController:alert animated:YES completion:nil];
                }
                
            } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                
                NSLog(@"==%@",error);
                
            }];
        }
        
        
    }else if (textField == self.veriftyTextField){
        
        if (![self checkPassWordWith:textField.text]) {
            [self showHint:@"请输入6~18位数字和字母组合"];
            textField.text = @"";

        }
    }
}

//- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
//{
//    if (textField == self.self.telTextField) {
//        if (textField.text.length > 10) {
//            
//            [self showHint:@"请输入正确的手机号"];
//            
//            textField.text = [textField.text substringToIndex:11];
//        }
//    }
//    
//    return YES;
//    
//}

#pragma mark - Notification Method
-(void)textFieldEditChanged:(NSNotification *)obj
{
    
    if (self.telTextField.text.length > 10) {
        
        //            [self showHint:@"请输入正确的账号"];
        
        self.telTextField.text = [self.telTextField.text substringToIndex:11];
    }
}

- (void)tapAction{
    
    UIWebViewController * webVC = [UIWebViewController new];
    
    webVC.count = @"1";
    
    [self.navigationController pushViewController:webVC animated:YES];
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [self.telTextField resignFirstResponder];
    [self.veriftyTextField resignFirstResponder];
    [self.passwordTextField resignFirstResponder];
}





- (void)backToLastView{
    
    [self.navigationController popViewControllerAnimated:YES];
}


//MD5 加密
- (NSString *) md5:(NSString *) input {
    const char *cStr = [input UTF8String];
    unsigned char digest[CC_MD5_DIGEST_LENGTH];
    CC_MD5( cStr, strlen(cStr), digest ); // This is the md5 call
    
    NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
    
    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
        [output appendFormat:@"%02x", digest[i]];
    
    return  output;
}

-(BOOL)checkPassWordWith:(NSString *)string
{
    //6-20位数字和字母组成
    NSString *regex = @"^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,18}$";
    NSPredicate *   pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    if ([pred evaluateWithObject:string]) {
        return YES ;
    }else
        return NO;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
